//
//  MTYinjiView.m
//  met
//
//  Created by 李晓俊 on 2019/7/29.
//  Copyright © 2019 李晓俊. All rights reserved.
//

#import "MTYinjiView.h"

@implementation MTYinjiView

{
    
    CGRect myframe;
    
}
- (MTYinjiView *)initWithFrame:(CGRect)frame

{
    self = [super initWithFrame:frame];
    if (self) {
        NSArray *nibs=[[NSBundle mainBundle]loadNibNamed:@"MTOkTishiView" owner:nil options:nil];
        self=[nibs objectAtIndex:4];
        myframe = frame;
        
        
        self.bgView.userInteractionEnabled = YES;
        UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(remove)];
        [self.bgView addGestureRecognizer:tap];
        
        self.backgroundView.userInteractionEnabled = YES;
        UITapGestureRecognizer *tap2 = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(remove2)];
        [self.backgroundView addGestureRecognizer:tap2];
        
//        self.height.constant = 30 + BottomHeight + 55;
//        [self needsUpdateConstraints];
//        
//        self.piaoliuView.userInteractionEnabled = YES;
//        UITapGestureRecognizer *tap3 = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(remove)];
//        [self.piaoliuView addGestureRecognizer:tap3];
        
    }
    return self;
}
-(void)drawRect:(CGRect)rect

{
    self.frame=myframe;//关键点在这里
}

- (void)remove {
    if (self.goButClick) {
        self.goButClick(@"1");
        [self removeFromSuperview];
    }
    
}
- (void)remove2 {
    [self removeFromSuperview];
}
@end
